module iopmp_config (
    input                              iopmpcfg_clk_i,
    input                              iopmpcfg_rst_n_i,
    input                 [32 - 1 : 0] iopmpcfg_haddr_i,
    input                 [4  - 1 : 0] iopmpcfg_hprot_i,                         
    input                 [1  - 1 : 0] iopmpcfg_hsel_i,
    input                 [3  - 1 : 0] iopmpcfg_hsize_i,
    input                 [2  - 1 : 0] iopmpcfg_htrans_i,
    input                 [32 - 1 : 0] iopmpcfg_hwdata_i,
    input                 [1  - 1 : 0] iopmpcfg_hwrite_i,

    input                 [1  - 1 : 0] iopmpcfg_access_ill_i,
    input                 [16 - 1 : 0] iopmpcfg_hit_i,

    input                 [1  - 1 : 0] iopmpcfg_cfgdone_i,

    output                [1  - 1 : 0] iopmpcfg_cfgen_o,

    output                [32 - 1 : 0] iopmpcfg_rule_o,

    output                [32 - 1 : 0] iopmpcfg_hrdata_o,
    output                [1  - 1 : 0] iopmpcfg_hready_o,
    output                [2  - 1 : 0] iopmpcfg_hresp_o,
    output                [1  - 1 : 0] iopmpcfg_r2t_intr_o
);
wire                      [1  - 1 : 0] t2r_a_clk_w;
wire                      [1  - 1 : 0] t2r_a_rst_n_w;
wire                      [1  - 1 : 0] t2r_a_en_box;
wire                      [1  - 1 : 0] t2r_a_write_box;
wire                      [12 - 1 : 0] t2r_a_addr_w;
wire                      [32 - 1 : 0] t2r_a_wdat_w;
wire                                   sr2if_rdy_w ;
wire                      [32 - 1 : 0] sr2if_rdat_w;
wire                                   sr2if_intr_w;


localparam ADDR_W                      = 12; 





tm_ahb_if
   #(
    .ADDR_W                            (ADDR_W                                 ),
    .MODE_SEL                          (1                                      )                   
    )
u1_tm_ahb_if
    (
    .tai_clk_i                         (iopmpcfg_clk_i                    ),            
    .tai_rst_n_i                       (iopmpcfg_rst_n_i                  ),              
    .tai_haddr_i                       (iopmpcfg_haddr_i                  ),              
    .tai_hprot_i                       (iopmpcfg_hprot_i                  ),              
    .tai_hsel_i                        (iopmpcfg_hsel_i                   ),             
    .tai_hsize_i                       (iopmpcfg_hsize_i                  ),              
    .tai_htrans_i                      (iopmpcfg_htrans_i                 ),               
    .tai_hwdata_i                      (iopmpcfg_hwdata_i                 ),               
    .tai_hwrite_i                      (iopmpcfg_hwrite_i                 ),               
    .tai_hrdata_o                      (iopmpcfg_hrdata_o                 ),               
    .tai_hready_o                      (iopmpcfg_hready_o                 ),               
    .tai_hresp_o                       (iopmpcfg_hresp_o                  ),              
    .tai_t2r_intr_o                    (iopmpcfg_r2t_intr_o               ),        

    .t2r_clk_w                         (t2r_a_clk_w                       ),                  
    .t2r_rst_n_w                       (t2r_a_rst_n_w                     ),                    
    .en_box                            (t2r_a_en_box                      ),                   
    .write_box                         (t2r_a_write_box                   ),                   
    .t2r_addr_w                        (t2r_a_addr_w                      ),                   
    .t2r_wdat_w                        (t2r_a_wdat_w                      ),                   
    .t2r_rdy_w                         (sr2if_rdy_w                       ),                  
    .t2r_rdat_w                        (sr2if_rdat_w                      ),                   
    .t2r_intr_w                        (sr2if_intr_w                      )                   
    );
iopmp_reg  #(12) u_iopmp_reg(
    
    .iopmprg_clk_i        (t2r_a_clk_w),
    .iopmprg_rst_n_i      (t2r_a_rst_n_w),

    .iopmprg_en_i         (t2r_a_en_box),     
    .iopmprg_write_i      (t2r_a_write_box),      
    .iopmprg_addr_i       (t2r_a_addr_w),
    .iopmprg_wdat_w_i     (t2r_a_wdat_w), 

    .iopmprg_access_ill_i (iopmpcfg_access_ill_i), 
    .iopmprg_hit_i        (iopmpcfg_hit_i), 

    .iopmprg_cfgdone_i    (iopmpcfg_cfgdone_i),

    .iopmprg_rdy_w_o      (sr2if_rdy_w ), 
    .iopmprg_rdat_w_o     (sr2if_rdat_w),
    .iopmprg_intr_w_o     (sr2if_intr_w),

    .iopmprg_cfgen_o      (iopmpcfg_cfgen_o),  

    .iopmprg_rule_o       (iopmpcfg_rule_o) 
);

endmodule
